package com.metacube.questionbank.service;

import java.util.List;

import com.metacube.questionbank.model.Answer;

/*
 * @author Team Neeraj Jain
 * */
public interface VoteService {
	/*
	 * @param answerId id of answer This method returns no of likes for a
	 * particular answer
	 * 
	 * @return nLikes no. of likes
	 */
	public int getUpvotesForAnswer(int answerId);

	/*
	 * @param answerId id of answer This method returns no of dislikes for a
	 * particular answer
	 * 
	 * @return nLikes no. of dislikes
	 */
	public int getDownvotesForAnswer(int answerId);

	/*
	 * @param answers list of answers This method returns a list that contains
	 * no. of likes for each answer in the list.
	 * 
	 * @return list of likes
	 */
	public List<Integer> getUpVotes(List<Answer> answers);

	/*
	 * @param answers list of answers This method returns a list that contains
	 * no. of dislikes for each answer in the list.
	 * 
	 * @return list of dislikes
	 */
	public List<Integer> getDownVotes(List<Answer> answers);

	/*
	 * @param userId id of user
	 * 
	 * @param ansId id of answer
	 * 
	 * @param status like or dislike This method updates the likes or dislikes
	 * for a particular answer
	 */
	public void insertUpvoteStatus(int userId, int ansId, int status);
}
